import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from "@/views/Login";
import SystemAdmin from "@/views/SystemAdmin";
import DormitoryAdminAdd from "@/views/DormitoryAdminAdd";
import DormitoryAdminManager from "@/views/DormitoryAdminManager";
import DormitoryAdminUpData from "@/views/DormitoryAdminUpData";
import StudentAdd from "@/views/StudentAdd";
import StudentManager from "@/views/StudentManager";
import StudentUpData from "@/views/StudentUpData";
import BuildingAdd from "@/views/BuildingAdd";
import BuildingManager from "@/views/BuildingManager";
import BuildingUpData from "@/views/BuildingUpData";
import DormitoryAdd from "@/views/DormitoryAdd";
import DormitoryManager from "@/views/DormitoryManager";
import DormitoryUpData from "@/views/DormitoryUpData";
import MoveoutRegister from "@/views/MoveoutRegister";
import MoveRecord from "@/views/MoveRecord";
import AbsentRecord from "@/views/AbsentRecord";
import DormitoryAdmin from "@/views/DormitoryAdmin";
import AbsentRegister from "@/views/AbsentRegister";
import AbsentRecord2 from "@/views/AbsentRecord2";

Vue.use(VueRouter)

const routes = [
  {
    path: '/systemAdmin',
    name: '系统管理员',
    component: SystemAdmin,
    redirect:'/dormitoryAdminAdd',
    children:[
      {
        path: '/dormitoryAdminAdd',
        name: '添加宿管',
        component: DormitoryAdminAdd
      }
      ,{
        path: '/dormitoryAdminManager',
        name: '宿管管理',
        component: DormitoryAdminManager
      }
      ,{
        path: '/dormitoryAdminUpData',
        name: '宿管编辑',
        component: DormitoryAdminUpData
      }
      ,{
        path: '/studentAdd',
        name: '添加学生',
        component: StudentAdd
      }
      ,{
        path: '/studentManager',
        name: '学生管理',
        component: StudentManager
      }
      ,{
        path: '/studentUpData',
        name: '学生更新',
        component: StudentUpData
      }
      ,{
        path: '/buildingAdd',
        name: '添加楼宇',
        component: BuildingAdd
      }
      ,{
        path: '/buildingManager',
        name: '楼宇管理',
        component: BuildingManager
      }
      ,{
        path: '/buildingUpData',
        name: '楼宇更新',
        component: BuildingUpData
      }
      ,{
        path: '/dormitoryAdd',
        name: '添加宿舍',
        component: DormitoryAdd
      }
      ,{
        path: '/dormitoryManager',
        name: '宿舍管理',
        component: DormitoryManager
      }
      ,{
        path: '/dormitoryUpData',
        name: '宿舍更新',
        component: DormitoryUpData
      }
      ,{
        path: '/moveoutRegister',
        name: '迁出登记',
        component: MoveoutRegister
      }
      ,{
        path: '/moveRecord',
        name: '迁出记录',
        component: MoveRecord
      }
      ,{
        path: '/absentRecord',
        name: '缺寝记录',
        component: AbsentRecord
      }
    ]
  },
  {
    path: '/dormitoryAdmin',
    name: '宿舍管理员',
    component: DormitoryAdmin,
    redirect:'/absentRegister',
    children: [{
      path: '/absentRegister',
      name: '学生缺寝登记',
      component: AbsentRegister
    },
      {
        path: '/absentRecord2',
        name: '学生缺寝记录',
        component: AbsentRecord2
      }]
  },{
    path: '/',
    name: '登录',
    component: Login
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
